﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Meqs.Entity;
using Meqs.Logic.Interface;

namespace Meqs.Logic.Implement
{
    public class ClassEvalItemCatchLogic : CommonLogic<ClassEvalItemCatch, int>, IClassEvalItemCatchLogic
    {
        #region Implementation of ICommonLogic<ClassEvalItemCatch, int>

        /// <summary>
        /// 创建对象
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int Create(ClassEvalItemCatch entity)
        {
            return CreateObject(entity);
        }

        /// <summary>
        /// 更新对象
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int Update(ClassEvalItemCatch entity)
        {
            return UpdateObject(entity);
        }

        /// <summary>
        /// 删除对象
        /// </summary>
        /// <param name="entityId"></param>
        /// <returns></returns>
        public int Delete(int entityId)
        {
            return DeleteObject(entityId);
        }

        /// <summary>
        /// 删除所有对象
        /// </summary>
        /// <returns></returns>
        public int DeleteAll()
        {
            return DeleteAllObject();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="entityId"></param>
        /// <returns></returns>
        public ClassEvalItemCatch FindById(int entityId)
        {
            return FindObjectById(entityId);
        }

        /// <summary>
        /// 检索对象数量
        /// </summary>
        /// <returns></returns>
        public int FindCount()
        {
            return FindObjectByCount();
        }

        /// <summary>
        /// 检索对象
        /// </summary>
        public IList<ClassEvalItemCatch> FindAll()
        {
            return FindAllObject();
        }

        /// <summary>
        /// 检索对象数量
        /// </summary>
        /// <returns></returns>
        public int FindCount(Hashtable table)
        {
            return FindObjectByCount(table);
        }

        /// <summary>
        /// 检索对象
        /// </summary>
        public IList<ClassEvalItemCatch> FindAll(Hashtable table)
        {
            return FindObject(table);
        }

        #endregion

        /// <summary>
        /// 插入
        /// </summary>
        public int InsertClassEvalItemCatch(ClassEvalItemCatch mpic, string schoolMark)
        {
            Hashtable ht = new Hashtable();
            ht.Add("ClassEvalItemCatch", mpic);
            ht.Add("SchoolMark", schoolMark);
            return (int)InsertCustomer("ClassEvalItemCatch.InsertClassEvalItemCatch", ht);
        }

        /// <summary>
        /// 删除
        /// </summary>
        public int DeleteClassEvalItemCatch(int classID, int recordID, string schoolMark)
        {
            Hashtable ht = new Hashtable();
            ht.Add("ClassID", classID);
            ht.Add("RecordID", recordID);
            ht.Add("SchoolMark", schoolMark);
            return DeleteCustomer("ClassEvalItemCatch.DeleteClassEvalItemCatch", ht);
        }
    }
}
